package com.alibaba.citrus.cr.mn.order.center.facade.function.convert;

import com.epoch.app.crforecastsales.model.dto.ForecastOrderLineBizDO;
import com.epoch.app.mnordercenter.model.dto.AnalysisForecastBizDTO;

import java.util.List;
import java.util.stream.Collectors;

public class AnalysisForecastBizDTOTODOConvert {
    public static ForecastOrderLineBizDO convert(List<AnalysisForecastBizDTO> analysisForecastBizDTOS) {
        List<String> forecastBizNoList = analysisForecastBizDTOS.stream().map(AnalysisForecastBizDTO::getSalesOrderNo).distinct().collect(Collectors.toList());
        List<String> lineNoList = analysisForecastBizDTOS.stream().map(AnalysisForecastBizDTO::getLineNum).distinct().collect(Collectors.toList());
       return ForecastOrderLineBizDO.builder().forecastOrderBizNoList(forecastBizNoList).lineNoList(lineNoList).build();
    }
}
